package com.jjiang.bbmall.order.web;

import com.jjiang.bbmall.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class PayWebController {

    @Autowired
    OrderService orderService;

    @GetMapping("/payOrder")
    public String payOrder(@RequestParam("orderSn") String orderSn) {
        // TODO 无需支付，跳过了支付宝过程
        // 修改数据库中订单的状态
        Boolean result = orderService.handlePayResult(orderSn);
        return "redirect:http://127.0.0.1:8000/list.html";
    }
}
